package com.sino.struts2;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;
import com.sino.business.IZjclService;
import com.sino.model.ZjclModel;

public class ZjclAction extends ActionSupport{
	
	private IZjclService zjclService = null;
	
	private ZjclModel zjclModel = null;
	private String zlid;
	
	public String getZlid() {
		return zlid;
	}
	public void setZlid(String zlid) {
		this.zlid = zlid;
	}
	//----------------------显示证件材料
	public String viewZjcl(){
		return this.SUCCESS;
	}
	//---------------------保存证件材料目录
	public String saveZjcl(){
		HttpSession session = ServletActionContext.getRequest().getSession();
		String zlId = (String)session.getAttribute("zlid");
		zjclModel.setZlId(zlId);
		this.getZjclService().saveZjcl(zjclModel);
		return this.SUCCESS;
	}
	//---------------------更新证件材料目录
	public String updateZjcl(){
		HttpSession session = ServletActionContext.getRequest().getSession();
		String zlId = (String)session.getAttribute("zlid2");
		zjclModel.setZlId(zlId);
		this.getZjclService().saveZjcl(zjclModel);
		return this.SUCCESS;
	}
	//---------------------查找证件材料目录
	public String findZjcl(){
		HttpSession session = ServletActionContext.getRequest().getSession();
		String zlId = (String)session.getAttribute("zlid");
		this.setZjclModel(this.getZjclService().findZjcl(zlId));
		return this.SUCCESS;
	}
	public String findZjclToPrint(){
		
		this.setZjclModel(this.getZjclService().findZjcl(zlid));
		return this.SUCCESS;
	}
	//---------------------查找证件材料目录---用于更新
	public String findUpdateZjcl(){
		HttpSession session = ServletActionContext.getRequest().getSession();
		String zlId = (String)session.getAttribute("zlid2");
		this.setZjclModel(this.getZjclService().findZjcl(zlId));
		return this.SUCCESS;
	}
	//----------------------接口
	public ZjclModel getZjclModel() {
		return zjclModel;
	}
	public void setZjclModel(ZjclModel zjclModel) {
		this.zjclModel = zjclModel;
	}
	public IZjclService getZjclService() {
		return zjclService;
	}
	public void setZjclService(IZjclService zjclService) {
		this.zjclService = zjclService;
	}
	
}
